GBML manual / Cutscenes

cutscene_active

True while any (non-zero-step) cutscene is playing.

Syntax

cutscene_active() -> bool

Returns

bool

Description

True while any (non-zero-step) cutscene is playing.

What this gates

This is exactly the flag that freezes ordinary Step/Alarm/Button/Movement/Collision dispatch project-wide - the same one a room transition already sets while it plays. A project rarely needs to read it directly (the freeze already does its job without any code asking for it), but it is useful for a Step event that wants to skip its own logic while a scene is showing, or for polling "is it over yet" from somewhere that is never frozen (a Draw event, or the same object that called cutscene_start).

A zero-step cutscene is a special case worth knowing about: cutscene_start on one returns true (nothing prevented it from running), but this function never reads true for it, not even for a single frame - there is nothing to freeze gameplay for.

Example

var show_gameplay_hint = ! cutscene_active();

A Draw event - unlike Step, this keeps running through a cutscene - reading whether to show something that only makes sense during ordinary gameplay (a "press A to talk" prompt, say) and hide it while a scene has taken over instead. Most objects need nothing like this at all: their own Step/Alarm/Button/Movement/Collision code already does not run while a scene plays, so there is usually nothing left to guard.

On the GBA

This is exactly what freezes ordinary Step/Alarm/Button/Movement/Collision dispatch project-wide while it reads true - the same gate a room transition already uses. Poll it in a Step event that needs to know, or - usually better - react to the moment a scene ends by checking it right after calling cutscene_skip()/cutscene_stop(), or from wherever cutscene_start() itself was called once the scene you started is expected to be done.

See also: cutscene_startcutscene_current